set(ST_HAL_FOUND true)

set(ST_HAL_INCLUDE_DIRS
    ${CMAKE_MODULE_PATH}/HAL/Core/Inc
    ${CMAKE_MODULE_PATH}/HAL/Drivers/STM32F4xx_HAL_Driver/Inc
    ${CMAKE_MODULE_PATH}/HAL/Drivers/STM32F4xx_HAL_Driver/Inc/Legacy
    ${CMAKE_MODULE_PATH}/HAL/Drivers/CMSIS/Device/ST/STM32F4xx/Include
    ${CMAKE_MODULE_PATH}/HAL/Drivers/CMSIS/Include
)

set(ST_HAL_SRCS
    ${CMAKE_MODULE_PATH}/HAL/Core/Src/main.c
    ${CMAKE_MODULE_PATH}/HAL/Core/Src/gpio.c
    ${CMAKE_MODULE_PATH}/HAL/Core/Src/usart.c
    ${CMAKE_MODULE_PATH}/HAL/Core/Src/stm32f4xx_it.c
    ${CMAKE_MODULE_PATH}/HAL/Core/Src/stm32f4xx_hal_msp.c
    ${CMAKE_MODULE_PATH}/HAL/Core/Src/sysmem.c
    ${CMAKE_MODULE_PATH}/HAL/Core/Src/syscalls.c
    ${CMAKE_MODULE_PATH}/HAL/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_uart.c
    ${CMAKE_MODULE_PATH}/HAL/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc.c
    ${CMAKE_MODULE_PATH}/HAL/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc_ex.c
    ${CMAKE_MODULE_PATH}/HAL/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash.c
    ${CMAKE_MODULE_PATH}/HAL/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ex.c
    ${CMAKE_MODULE_PATH}/HAL/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ramfunc.c
    ${CMAKE_MODULE_PATH}/HAL/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_gpio.c
    ${CMAKE_MODULE_PATH}/HAL/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma_ex.c
    ${CMAKE_MODULE_PATH}/HAL/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma.c
    ${CMAKE_MODULE_PATH}/HAL/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr.c
    ${CMAKE_MODULE_PATH}/HAL/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr_ex.c
    ${CMAKE_MODULE_PATH}/HAL/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cortex.c
    ${CMAKE_MODULE_PATH}/HAL/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c
    ${CMAKE_MODULE_PATH}/HAL/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_exti.c
    ${CMAKE_MODULE_PATH}/HAL/Core/Src/system_stm32f4xx.c
    ${CMAKE_MODULE_PATH}/HAL/Core/Src/stm32f4xx_hal_timebase_tim.c 
    ${CMAKE_MODULE_PATH}/HAL/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim.c 
    ${CMAKE_MODULE_PATH}/HAL/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim_ex.c
    ${CMAKE_MODULE_PATH}/HAL/Core/Src/sdio.c 
    ${CMAKE_MODULE_PATH}/HAL/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_sdmmc.c 
    ${CMAKE_MODULE_PATH}/HAL/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_sd.c 
    ${CMAKE_MODULE_PATH}/HAL/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_mmc.c

)


set(ST_HAL_STARTUP_FILE ${CMAKE_MODULE_PATH}/HAL/startup_stm32f407xx.s)
set(ST_HAL_LINKER_SCRIPT ${CMAKE_MODULE_PATH}/HAL/STM32F407ZGTx_FLASH.ld)

message(status  "ST_HAL FOUND")

